package com.fyzk.adapter;

import android.content.res.Resources;
import android.support.annotation.LayoutRes;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fyzk.bean.DocumentaryMenuResponse;
import com.tyjc.lottery.R;

/**
 * Created by Administrator on 2018/9/26.
 */

public class FindAdapter extends BaseQuickAdapter<DocumentaryMenuResponse, BaseViewHolder> {
    public FindAdapter() {
        super(R.layout.item_find);
    }

    @Override
    protected void convert(BaseViewHolder helper, DocumentaryMenuResponse item) {
        Resources resources = mContext.getResources();
        int res = resources.getIdentifier(item.getIcon(), "drawable", mContext.getPackageName());
        helper.setImageResource(R.id.iv_avatar, res);
        helper.setText(R.id.tv_title, item.getName());
        helper.setText(R.id.tv_describe, item.getDescribe());
    }
}
